// useUniqueId.js
import { ref } from 'vue';

export default function useUniqueId(prefix = 'CH') {
  const generateUniqueId = () => {
    const timestamp = Date.now().toString(16);
    const randomStr = Math.random().toString(36).slice(2, 10);
    return `${prefix}${timestamp}${randomStr}`;
  };

  const uniqueId = ref(generateUniqueId());

  return {
    uniqueId,
    generateUniqueId
  };
}